import { Controller, Inject, Get, Post, Body } from '@midwayjs/core'
import { MaterialDonateRecordService } from '../../service/admin/MaterialDonateRecord'
import { BaseController } from '../base.chontroller'

@Controller('/donate/record')
export class DonateController extends BaseController {
  @Inject()
  service!: MaterialDonateRecordService

  @Get('/list')
  async list() {
    try {
      const queryInfo = this.ctx.request.query
      
      const data = await this.service.list(queryInfo)
      return this.success<IList<any>>(data)
    } catch (err: any) {
      return this.fail(err.message || '获取列表失败')
    }
  }
}
